<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="text" id="aaa" />
    <input type="text" id="bbb" />
    <input type="text" id="ccc" />
    <input type="text" id="ddd" />
    <script>
        console.info(document.getElementById("aaa"))
        document.getElementById("ccc").style.backgroundColor = "#FF0000";

        let promise = new Promise(function (resolve, reject) {
            console.info("111111111111")
            setTimeout(() => reject("done!"), 1000);
            console.info("2222222222")
        });

        // resolve runs the first function in .then
        promise.then(
            result => alert(result)
        ).catch(
            error => alert(error + "@@@@")
        )

    </script>
</body>

</html>